//
//  TasteViewController.m
//  Taste
//
//  Created by 徐昊 on 16/8/29.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "TasteViewController.h"
#import "HomePageNaviViewController.h"
#import "HomepageViewController.h"
#import "SelectionNaviViewController.h"
#import "SelectionViewController.h"
#import "ShowNaviViewController.h"
#import "ShowViewController.h"
#import "CookBookNaviViewController.h"
#import "CookBookViewController.h"
#import "MineNaviViewController.h"
#import "MineViewController.h"
@interface TasteViewController ()

@end

@implementation TasteViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.viewControllers = [self createViewControllers];
}
- (NSArray<UIViewController *> *)createViewControllers {
    NSMutableArray *arrOfVC = [NSMutableArray array];
    HomepageViewController *homeVC = [[HomepageViewController alloc] init];
    HomePageNaviViewController *homeNavi = [[HomePageNaviViewController alloc] initWithRootViewController:homeVC];
    [arrOfVC addObject:homeNavi];
    homeNavi.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"主页" image:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_HomePage"]  selectedImage:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_HomePage_HL"]];
    [homeNavi.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor redColor]} forState:UIControlStateSelected];
    
    
    SelectionViewController *seleVC = [[SelectionViewController alloc] init];
    SelectionNaviViewController *seleNavi = [[SelectionNaviViewController alloc] initWithRootViewController:seleVC];
    [arrOfVC addObject:seleNavi];
    seleNavi.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"精选餐厅" image:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_Restaurant"] selectedImage:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_Restaurant_HL"]];
    [seleNavi.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor redColor]} forState:UIControlStateSelected];
    
    ShowViewController *showVC = [[ShowViewController alloc] init];
    ShowNaviViewController *showNavi = [[ShowNaviViewController alloc] initWithRootViewController:showVC];
    [arrOfVC addObject:showNavi];
    showNavi.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"秀场" image:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_ShowField"] selectedImage:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_ShowField_HL"]];
    [showNavi.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor redColor]} forState:UIControlStateSelected];
    
    CookBookViewController *cookVC = [[CookBookViewController alloc] init];
    CookBookNaviViewController *cookNavi = [[CookBookNaviViewController alloc] initWithRootViewController:cookVC];
    [arrOfVC addObject:cookNavi];
    cookNavi.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"大师菜谱" image:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_Cookbook"] selectedImage:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_Cookbook_HL"]];
    [cookNavi.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor redColor]} forState:UIControlStateSelected];
    
    MineViewController *mineVC = [[MineViewController alloc] init];
    MineNaviViewController *mineNavi = [[MineNaviViewController alloc] initWithRootViewController:mineVC];
    [arrOfVC addObject:mineNavi];
    mineNavi.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"个人" image:[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_My"] selectedImage:[[UIImage imageNamed:@"LZImg_Universal_ToolBar_Icon_My_HL"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [mineNavi.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor redColor]} forState:UIControlStateSelected];
    
    return arrOfVC;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
